
_side= side player;

_units=[];

lastTime=time-70;

while{!GameEnd} do {

	// update list of units only each 10 secs
	if(time - lastTime>60)then{
		_units=allUnits;
		lastTime=time;
	};

	// we show informations only if the agent open his map (to save cpu usage) 
	// [tank dont have map but a control map so dont restrict to visibleMap]
	waitUntil{ visibleMap or (player==TankPlayer) };
	
	_markers=[];

	

	{ // forEach
	
		if((side _x) == _side) then{
		
			//player sideChat format["TEST : %1 , %2",_x, _side countSide _units];
				
			_markerobj = createMarkerLocal[format["mt%1",_x],getPos _x];
			_markerobj setMarkerShapeLocal "ICON";
			_markerobj setMarkerTypeLocal "DOT";
			_markerobj setMarkerColorLocal "ColorGreenAlpha";
			_markerobj setMarkerTextLocal format["%1",name _x];
			
			_markers=_markers+[_markerobj];
		};
		
		
		
	}forEach _units;
		
	sleep 0.5;
	
	{
		deleteMarkerLocal _x;
	}forEach _markers;

	
};